"Active" the checkbox by default in BP transaction SAP - sap-erp

I am wondering, If I can change somehow the logic of creating Business Partners? The checkbox "Check double invoice" in Credit - Company Code - Vendor: Payment Transaction, is unchecked by default:
Is there any way to make this field checked by default? If someone know, could one please explain in details, if it is possible, since I am new in ABAP.
Thanks in advance.
I tried to look in SE11 LFB1 and change the initial value of the field, but it seems to me that it is unreal to change the value of standard field set by SAP itself.

Related

Changing message box activation

My database has a unique field for the name of the child receiving gifts from our Christmas project and notifies us of the duplication as we leave the record. However that is many keystrokes later. Is there a way to activate the message upon leaving the field rather than the record.?
Yes, use the BeforeUpdate event of the field. In this, look up the value entered and, if found, set:
Cancel = True
and pop a messagebox.

Access New ID Field YYYYMMNN [duplicate]

I need to automatically generate a 12 character value for my Business Key. Without any user interaction.
8 character -> Today Date (yyyymmdd or ddmmyyyy).
+
4 character -> Sequential Number (0001,0002,0003).
The Sequential Number must reset on each new day.
Is it possible to do this in Microsoft Access 2010+ without any coding involved?
Since you are using Access 2010+ the best way to accomplish your goal would be to use a Before Change data macro like this
To create the Before Change macro, click the "Before Change" button on the "Table" tab of the ribbon when the table is open in Datasheet View:
For more details on Data Macros see
Create a data macro
Good question, thanks for the challenge!
After some search, it seems it's possible to do that.
You can prefix the AutoNuber value by processing like the explanation available here: http://www.databasedev.co.uk/add_prefix.html
You can try to specify in the format of the field a format(now(),"ddmmyyyy").
Check this page for more informations, another user seems to have the same problem and got a solution: http://bytes.com/topic/access/answers/695188-custom-made-autonumber-show-todays-date
Hope it's helping you!

MS Access 2010- How to update field on one table based on field in another table

I'm designing a database to track requests. Currently, I have a form that its' record source is based off a query "Unassigned Requests". This query is based off my table Requests, and returns all "unassigned Requests". In this form, I would like the status field to change to "Assigned", once a Tech field has been assigned to the request. I currently have the Default for the Tech Assigned field set to "Blank', and the status field set to 'Unassigned". Both of these fields are combo boxes. The status field has a control source from the request table and row source from the status table. The tech assigned field has a control source from the Tech table and the row source is based off a query.
I have tried multiple solutions that have not seemed to work. I have limited experience with Macros and VBA. I would appreciate any suggestions on solving this problem.
I am going to make some assumptions regarding your post and if any are incorrect please let me know.
You have a request form where a request is assigned to a Tech. On that form there is a dropdown for the status, and also for the Tech.
You want to make it so when the tech dropdown is filled out with a tech's name you want the dropdown to change to assigned.
If this is the case I would recommend using the Tech Assigned field's AfterUpdate event. The code would look something like this:
Private Sub cboTech_Assigned_AfterUpdate()
If Nz(Me.cboTech_Assigned.Value, "") <> "" Then
Me.cboStatus = "Assigned"
Else
Me.cboStatus = ""
End If
End Sub
Obviously you will need to adjust to your own naming scheme. I should also point out that I don't even know if that Nz function is needed, I have just gotten into the habit of putting it everywhere. If I misunderstood something about what you want to do please let me know!

MS Access 2007 - controlling UI behaviour after attempt to insert duplicate record

Creating a simple UI using MS Access, hoping to do minimal actual coding (actually helping a friend who is not a coder).
Simplified requirement: Single table, primary key is phone number, lots of other non-mandatory fields. Display a form allowing just the phone number to be entered, if a record with that key exists display the full record, if a record with that key does not exist bring up an form allowing the other fields to be entered for this phone number and hence create a new record.
Q1: Any simple way to achieve this kind of function? Example?
We've got some of this going with a standard form, can execute code if insertion fails, but a standard dialogue box is displayed warning about the duplciate key violation.
Q2: How can we trap that attempted insertion, avoid having the dialogue come up?
You will have to get your hands dirty and write some code to get this outcome. A starting point would be something like this presto code. Post back if you get stuck on any of the parts.
If fCheckIfRecordExists(lYourKey)=True then
Docmd.OpenForm “frmEditExistingRecord”
Else
Docmd.OpenForm “frmEnterNewRecord”
End if
Public function fCheckIfRecordExists (lYourKey as Long) as Boolean
‘Code to check if a record exists, simple method is to use dLookup or a count SQL statement with the criteria as the key you are trying to find
End function
EDIT:
First things first make a form with 1 text box called txtPhone_number and a command button called cmdSearch.
Next put this bit of code in the module behind the form
Public Function fDoes_record_exist(strPhone_number As String) As Boolean
If DCount("Phone_number", "tblYour_table", "Phone_number=" & strPhone_number) > 0 Then
fDoes_record_exist = True
Else
fDoes_record_exist = False
End If
End Function
Next you need to put some code behind the click event of the command button. This code can be expanded on to check for a valid phone number later if you want
If fDoes_record_exist(Me.txtPhone_number) = True Then
DoCmd.OpenForm "frmShow_existing_record"
Else
DoCmd.OpenForm "frmEnter_new_record"
End If
That should set you on your way nicely but post back if you run into problems
Here is an overview of the process with Access logic:
You need an unboud control labelled Phone in the form header, where user will be able to enter the phone number to search. You need to use the After_Update event of that control to trigger your search. There will be a second Phone control, bound this time, in the Detail section of the form for effective data entry/update.
Use the Form_Error event to intercept the error message when user tries to save a duplicate key, in order to display a nice message, and eventually Cancel his changes.
The advice from Kevin Ross to use VB Code is clearly one approach, and I think is appropropriate if we anticipate less trivial requirements in future. However I'm in a situation where I'm helping someone with zero coding background and hence if possible I'd prefer to let them use simple Macros rather than full-scale VB.
As it happens the functionality I require can be implemented with just Macros, and it depends on the suggestion from iDevelop.
The outline of the solution I used:
Create an InitialEntry form with no association to any particular table, it has:
a data entry field for the telephone number
a read-only text box where I can display a message
a button labelled Add
a button labelled Show
I write three macros:
A macro AlreadyExists that displays a message saying "We already that one"
A macro NewEntry that opens a data entry form for my table, in Add mode, and which copies the phone number from InitialEntry!TelephoneNumber
A macro TestForExisting this uses a condition
DCount("*","MyTable","[PhoneNumber] = [FormPhoneNumber] " ) > 0
to control whether to execute AlreadyExists, and a similar test to control whether to call NewEntry.
While this is not as efficient as VB, it does seem to be understandable by a non-coder, so at least we can implement our application.

What's the best way for storing record's ID on web page while editing in ASP.NET MVC?

While a record is edited,how should be the ID stored ? I could have a textbox with enabled false, but I don't like this approach.
In ASP.NET I used to have a property which has saved the value in viewstate(Actually a hidden field + encrypted value).
The only solution I found Is to use a hidden field. Is it save enough ?
Are there any others options ?
If you wish it to work in stateless mode, you need to add id to the url.
http://mywebsite/users/123/edit
Otherwise use the Session collection.
There is also the TempData collection to store data between two requests only. It may or may not be of use to you though.
P.S. Hidden field is also an option.
Is the ID auto-generated by SQL Server?
If yes, hiding this is an approach you can consider. Either you can hide it or remove it entirely.
We removed all the ID textboxes on our ASP.NET MVC Projects.
Cheers
It is save enough if you check permissions.
If a user is allowed to edit something with ID 1 and 2 nothing happens if he decides do change the ID. If he changes ID 1 to ID 2 it is the same as if he edits the dataset with ID 2 in the userinterface. If he tries to change the ID to 3 you have to block it ("You are not allowed to edit this dataset ...")