cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Default Values

Former Member
0 Likes
538

Hi Guys,

is this possible to set in the Customer BO default values? F.E i need to have Currency in EUR and Payment terms as 20 days net?

Does anyone has a sample code?

BR Manfred

View Entire Topic
lessip
Participant
0 Likes

Hello Manfred,

simply set the "Initial Value" property for the input in the DataModel, as described in this SCN-Post

Best regards,

Patric

Former Member
0 Likes

Hi,

This is a good hint, but I need to extend the standard BO without any modification. I need to change the Value form Customer.bo. Currency must be EUR as default.

BR MAnfred

lessip
Participant
0 Likes

Hello Manfred,

as far as I know this is impossible. I only know the possibility to provide default values for custom fields.

Perhaps you can activate default values for standard datafields in the finetuning.?

Best Regards,

Patric

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Manfred,

What about doing it in the BODL code:

     element Currency : CurrencyCode = "EUR";

     element Amount : Amount = { currencyCode = "EUR" };

HTH,

   Horst

Former Member
0 Likes

Yes, but this is a Standardfield in the BO. How do I get access to this field?

BR Manfred

lessip
Participant
0 Likes

you can create an XBO for the customer-BO, where you can add the BODL code from Horst.

Former Member
0 Likes

Hi Manfred,

For normal PSM released standard fields, you can assign default value in AfterModify event of respective nodes.

e.g

In Customer-> Root-> AfterModify, you can assign InternalID to an default value.

this.InternalID = "CUS1";

But Sales Data is SalesArrangement BO in ByD. It is [0,n] association from Customer BO.

SalesArrangement association cannot be created from Customer BO. Instead, SalesArrangement can be created separately. CustomerUUID + SalesOrganisationUUID is unique in SalesArrangement.

Here is how to create an instance of SalesArrangement.

import AP.FO.MOM.Global;

var sa: elementsof SalesArrangement;

var fu= FunctionalUnit.Retrieve("123"); // 123 is just an example

if(fu.IsSet()){

  sa.CustomerUUID=this.UUID;

  sa.DistributionChannelCode.content="01";

  sa.SalesOrganisationUUID = fu.UUID;

  var testInstance = SalesArrangement.Create(sa);

      testInstance.PricingTerms.CurrencyCode ="EUR";

}

Currency Code is not just a simple field.

Best Regards,

Fred

Former Member
0 Likes

Hello Fred,

thank you for your post, it really helped me to understand how it could work, but I have one more question regarding your code snippet.

You wrote:

"var fu= FunctionalUnit.Retrieve("123"); // 123 is just an example"


As I understand it, the "123" is the UUID/ID of the functional unit. (Please correct me if I am wrong?)


But how is it possible to get this UUID/ID of the functional unit from my customer?

I tried to get from my customer to the right functional unit, but without any success. Maybe you have an idea...

BR Manfred

Former Member
0 Likes

Hi Fred,

->As I understand it, the "123" is the UUID/ID of the functional unit

Yes, correct.

->But how is it possible to get this UUID/ID of the functional unit from my customer?

No, you cannot.  You will need to assign a default sales unit just as I did.


Sales Organization assignment is mandatory for every customer, basically.

You will have to somehow need to determine a sales organization for the customer.


When you click View All and go to check more details of a customer, under Sales tap, you can see Currency and Payment Terms are just properties assigned to a sales organization. Without a sales organization, they cannot exist.


Best Regards,

Fred


former_member186648
Active Contributor
0 Likes

Hi Manfred,

Create XBO on Customer,
Create AfterModify event,

In the event Check if Sales Org is selected from the value help, if yes default the currency as mentioned by @Fred

Thanks, Pradeep.