Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jondgl

    (@jondgl)

    @duccsoup Sure thing.

    I the usual Name field for my record, and a text field called “Slug”. I created a simple Apex invokable method that takes a string and replaces all spaces with “-“, converted it to lowercase, removed all other characters. I invoke that method in a Record-triggered flow to process the Name and populate the Slug field. Note, this could certainly be done in a formula with a series of replaces and other functions, but it seemed tedious to me so I just used Apex.

    To be certain I never sent a slug to WordPress that was a duplicate of another post, I created a formula field that concatenated the 18-character case safe Id to the end of the slug, converted to lowercase, to create what I guess you may call the “full slug”.

    You then just map this field to the post_name field in OS4SF.

    Hope all that makes sense.

    Thread Starter jondgl

    (@jondgl)

    This was resolved by setting the post_name from Salesforce.

    Thanks again.

    Thread Starter jondgl

    (@jondgl)

    I just realized I can actually generate the post_name in Salesforce and sync that value over to WordPress, overwriting the default value. This will work for our needs. I imagine I just need to make sure that I can make this field unique.

    Thanks for all your help!

    Thread Starter jondgl

    (@jondgl)

    Thanks for your help! I think method 1 should work for us, but I seem to be coming up to a separate issue. I have mapped the post_name to a new Salesforce field, both using “WordPress > Salesforce” and “Sync” as the directions. The value is not written back to Salesforce. When I edit the Salesforce record, the SF-sourced fields update in WordPress, but the post_name is not sent back. Is there perhaps a specific setting somewhere I am forgetting/not aware of to enable this kind of sync back?

Viewing 4 replies - 1 through 4 (of 4 total)