on 2021 Oct 11 5:22 PM
I added an extension field for sales quotes via sap cloud app studio which should not be copied. How can I achieve that this extension field will be empty when a quote is copied?
Hello Miriam,
1) add a field to the CustomerQuote BOX on the root node.
//BO Extension
element Z_CustomerQuoteUUID : UUID;
2) Fill the field in the root-Before-Save script with the root node UUID (additional checks are required to make sure that the instance is writable, i.e. not in Status "completed").
3) In root-After-Modify check if the field is different...
//Before Save
foreach(var obj in this) {
if(obj.Z_CustomerQuoteUUID.content.IsInitial() && !obj.UUID.content.IsInitial()) {
//todo: writable check
obj.Z_CustomerQuoteUUID.content = obj.UUID.content;
}
}
//After Modfiy
foreach(var obj in this) {
if(!obj.Z_CustomerQuoteUUID.content.IsInitial() && obj.Z_CustomerQuoteUUID.content != obj.UUID.content) {
//todo: writable check
obj.Z_CustomerQuoteUUID.content = obj.UUID.content;
//clear your copied extension field here
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi mmiriam,
You can try creating a BeforeSave script on the Root node of the Sales Quote BO, which would check if the new document is being created as a copy and then, clear the extension field value.
Best regards,
Thiago
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.