Transform to CustomerSegmentAssignment

#1

Why are ther two transforms to CustomerSegmentAssignment in Residential?
TransformCustomerOrganizationToCustomerSubsegmentAssignment.c3typ
TransformCustomerOrganizationToCustomerSegmentAssignment.c3typ
Example of usefull case?

0 Likes

#2

A canonical should have many fields that can populate fields of different types and you need a transform for a type, this is way you see two transforms.

0 Likes

#3

In C3 doc, I can see any difference between TransformCustomerOrganizationToCustomerSegmentAssignment abd TransformCustomerOrganizationToCustomerSubsegmentAssignment

Analysing CanonicalCustmerOrganization, I can see that there are two different fields:
.) businessSegment
.) businessSubsegment

How can I know if
TransformCustomerOrganizationToCustomerSegmentAssignment.marketingSegment
is
CanonicalCustomerOrganization.businessSegment or
CanonicalCustomerOrganization.businessSubsegment

(of course, I can guess it).

0 Likes

#4

You shouldn’t guess but look for facts.
If you check the declaration of marketingSegment you will see that it’s using field businessSegment in TransformCustomerOrganizationToCustomerSegmentAssignment. Here is the declaration:

marketingSegment: MarketingSegment expression "{\"id\":\"concat(businessSegment,'_',sector)\"}"

If you check the declaration of marketingSegment you will see that it’s using field businessSubsegment in TransformCustomerOrganizationToCustomerSubsegmentAssignment. Here is the declaration:

marketingSegment: MarketingSegment expression "{\"id\":\"concat(businessSubsegment,'_',sector)\"}"

I hope this clarifies why there is a need for two transforms.

0 Likes

#5

Yes, very good,

But perhaps I miss a point: where can I find that code:

marketingSegment: MarketingSegment expression "{\"id\":\"concat(businessSegment,'_',sector)\"}"
marketingSegment: MarketingSegment expression "{\"id\":\"concat(businessSubsegment,'_',sector)\"}"
0 Likes

#6

After you type c3ShowType(TransformCustomerOrganizationToCustomerSegmentAssignment) then you can see below each field or method the following line Declaration show. Just click on the link and the code used to declare this field or method will be shown.

0 Likes

#7

You can also use the Type Designer tool from the Developer Tools, it will even show you the javascript code under the Code Editor tab if source code exists.

0 Likes